
function PlayCut(url) {
    fetch(url)
        .then(response => response.arrayBuffer())
        .then(arrayBuffer => context.decodeAudioData(arrayBuffer))
        .then(audioBuffer => {
            var source = context.createBufferSource();
            source.buffer = audioBuffer;
            source.connect(context.destination);
            source.start(0); // 立即播放
        })
        .catch(e => console.error('Error playing sound:', e));
}
// /// <summary>
// /// 播放音效(默认在摄像机位置播放)
// /// </summary>
// function PlayAudio(audioName,timer) {
//     adAnother.src = "TemplateData/Audio/" + audioName + ".MP3";
//     adAnother.currentTime = timer;
//     adAnother.play();
// }

// /// <summary>
// /// 停止音效
// /// </summary>
// function jsStopAudio() {
//     if(adAnother)
//     {
//         //adAnother.stop();
//     }
// }